Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix system process metricset for kernel processes #6224

Merged

Conversation

andrewkroh
Copy link
Member

On Linux, kernel processes don't have an exe on disk so the /proc/[PID]/exe symlink is broken. When Metricbeat tries to read the symlink it gets an error and it skips the whole process. This adds a check for ENOENT and ignores the error which allows kernel processes to be reported by Metricbeat. This is the error that it fixes.

2018-01-30T20:31:02.512Z	DEBUG	[processes]	process/process.go:443	Skip process pid=12113: error getting process exe for pid=12113: readlink /proc/12113/exe: no such file or directory

Fixes #5700

On Linux, kernel processes don't have an exe on disk so the `/proc/[PID]/exe` symlink is broken. When Metricbeat tries to read the symlink it gets an error and it skips the whole process. This adds a check for ENOENT and ignores the error which allows kernel processes to be reported by Metricbeat. This is the error that it fixes.

    2018-01-30T20:31:02.512Z	DEBUG	[processes]	process/process.go:443	Skip process pid=12113: error getting process exe for pid=12113: readlink /proc/12113/exe: no such file or directory

Fixes elastic#5700
@ruflin ruflin merged commit 6bde7d8 into elastic:master Jan 30, 2018
@ruflin
Copy link
Contributor

ruflin commented Jan 30, 2018

@andrewkroh Should we backport this one?

@andrewkroh andrewkroh added the needs_backport PR is waiting to be backported to other branches. label Jan 30, 2018
@andrewkroh andrewkroh removed the needs_backport PR is waiting to be backported to other branches. label Mar 29, 2018
andrewkroh added a commit to andrewkroh/beats that referenced this pull request Mar 29, 2018
On Linux, kernel processes don't have an exe on disk so the `/proc/[PID]/exe` symlink is broken. When Metricbeat tries to read the symlink it gets an error and it skips the whole process. This adds a check for ENOENT and ignores the error which allows kernel processes to be reported by Metricbeat. This is the error that it fixes.

    2018-01-30T20:31:02.512Z	DEBUG	[processes]	process/process.go:443	Skip process pid=12113: error getting process exe for pid=12113: readlink /proc/12113/exe: no such file or directory

Fixes elastic#5700

(cherry picked from commit 6bde7d8)
jsoriano added a commit that referenced this pull request Mar 29, 2018
Cherry-pick #6224 to 6.2: Fix system process metricset for kernel processes
@andrewkroh andrewkroh deleted the bugfix/mb/system-process-linux-kernel branch April 20, 2018 00:02
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
On Linux, kernel processes don't have an exe on disk so the `/proc/[PID]/exe` symlink is broken. When Metricbeat tries to read the symlink it gets an error and it skips the whole process. This adds a check for ENOENT and ignores the error which allows kernel processes to be reported by Metricbeat. This is the error that it fixes.

    2018-01-30T20:31:02.512Z	DEBUG	[processes]	process/process.go:443	Skip process pid=12113: error getting process exe for pid=12113: readlink /proc/12113/exe: no such file or directory

Fixes elastic#5700

(cherry picked from commit ee38051)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Cherry-pick elastic#6224 to 6.2: Fix system process metricset for kernel processes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metricbeat6.0 system module doesn't capture kernel process in Centos7
2 participants